import request from '@/utils/request'

// 查询device列表
export function list(pageSize, pageNum) {
  const data = {
    pageSize,
    pageNum,
  }
  return request({
    url: '/facility/facility/list',
    method: 'get',
    params: data
  })
}

// 新增device
export function add(data) {

  return request({
    url: '/facility/facility',
    method: 'post',
    params: data
  })
}
// 删除device
export function del(id) {
  return request({
    url: '/facility/facility/' + id,
    method: 'DELETE',
  })
}
// 修改device
export function update(data) {

  return request({
    url: '/facility/facility',
    method: 'put',
    params: data
  })
}
// 查询device详情
export function device(id) {
  return request({
    url: '/facility/facility/' + id,
    method: 'get',
  })
}
// 搜索device
export function inquire(data) {
  return request({
    url: '/facility/facility/list',
    method: 'get',
    params: data
  })
}
// 查询设备打印价格列表
export function priceList(code) {
  return request({
    url: '/facility/print/price/facility/list/' + code,
    method: 'get',
  })
}
// 查询打印类型列表
export function printType() {
  return request({
    url: '/facility/type/list',
    method: 'get',
  })
}
//新增设备打印价格
export function addPrintPrice(data) {
  return request({
    url: '/facility/print/price/facility',
    method: 'post',
    data
  })
}
//删除设备打印价格
export function delPrintPrice(ids) {
  return request({
    url: '/facility/print/price/facility/' + ids,
    method: 'DELETE',
  })
}
// 查询设备默认打印价格列表
export function defaultPrintingPrice() {
  return request({
    url: '/facility/print/price/list',
    method: 'get',
  })
}

//分账用户列表
export function separateList(params) {
  return request({
    url: '/separate/user/list/all',
    method: 'get',
    params:params
  })
}

//分账用户列表
export function facSeparateList(id) {
  return request({
    url: '/facility/facility/separate',
    method: 'get',
    params: {
      code: id
    }
  })
}

//新增设备打印价格
export function addSeparateUser(data) {
  return request({
    url: '/facility/facility/separate/add',
    method: 'post',
    data
  })
}

//新增设备打印价格
export function deleteSeparateUser(data) {
  return request({
    url: '/facility/facility/separate/delete',
    method: 'post',
    data
  })
}
//设备清零
export function facilityreset(code) {
  return request({
    url: '/facility/facility/facilityreset/'+code,
    method: 'get',
  })
}
